#ifndef TC_SMIF_HH
#define TC_SMIF_HH

/** \file SmIf.hh 
 * Declarations for the class Template.
 *
 * (c) Copyright by Semih Cemiloglu
 * All rights reserved, see COPYRIGHT file for details.
 *
 * $Id: SmIf.hh 119 2006-06-21 04:57:25Z semihc $
 *
 *
 */

#include "Global.hh"
#include "SmEvent.hh"
#include "SmState.hpp"


namespace TC {


  /**
   * The interface of any State Machine.
   */
  class SmIf
  {
  public:
    // TYPES
    typedef SmState State_t;
    typedef SmState::Action_t Action_t; 

    // CREATORS
    SmIf(State_t st);
    virtual ~SmIf();

    // ACCESSORS
    
    // MODIFIERS
    //! Initial state
    void init(State_t st);
    //! Transition to a target state
    virtual void tran(State_t) = 0;
    //! Setup the state machine before any dispatch
    virtual void setup(const SmEvent*) = 0;
    //! Dispatch an event to the state machine
    virtual void dispatch(const SmEvent*) = 0;

  protected:
    // MEMBERS
    //! Currently active state
    State_t m_state;

  private:
    // NOT ALLOWED
    SmIf();

  }; // end class


} // end namespace




#endif /* TC_SMIF_HH */
